<template>
    <view v-html="html" class="taro_html"></view>
</template>

<script lang='ts' setup>
    import Taro from '@tarojs/taro'
    import { computed } from 'vue'
    
    const props = defineProps<{
        content : string
    }>()

    const html = computed(() => {
        return props.content ? props.content.replaceAll('&nbsp;', '\xa0') : ''
    })

    Taro.options.html.transformElement = (el) => {
        if (el.nodeName === 'image') {
            el.setAttribute('mode', 'widthFix')
            el.setAttribute('show-menu-by-longpress', true)
        }
        return el
    }
</script>

<style lang='scss'>
    @import '@tarojs/taro/html.css';
    .taro_html {
        .h5-img{
            max-width: 100%;
        }
        
        

    }
</style>

